package com.huawei.appmarket.service.store.awk.node;

import android.content.Context;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import com.huawei.appmarket.service.store.awk.card.CourseListCard;
import com.huawei.appmarket.service.store.awk.card.ThreeLineCourseCard;
import com.huawei.appmarket.service.store.awk.card.TitleCard;
import java.util.ArrayList;
import o.azb;
import o.cdr;
import o.cgz;
import o.cht$d;
import o.chy;
import o.ewm.h;
import o.ewm.j;

public class ThreeLineCourseNode extends cdr {
    ThreeLineCourseCard ˊ;
    View ॱॱ;
    private View ᐝ;

    public ThreeLineCourseNode(Context context) {
        super(context, 1);
    }

    public boolean ॱ() {
        return true;
    }

    public boolean ˊ(ViewGroup viewGroup, ViewGroup viewGroup2) {
        LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -1);
        layoutParams.weight = 1.0f;
        LayoutInflater from = LayoutInflater.from(this.ॱ);
        new RelativeLayout.LayoutParams(-1, 3).setMargins(0, 0, 0, 0);
        int ˏ = azb.ˏ(this.ॱ);
        int ˊ = azb.ˊ(this.ॱ);
        int applyDimension = (int) TypedValue.applyDimension(1, -16.0f, this.ॱ.getResources().getDisplayMetrics());
        this.ˊ = new ThreeLineCourseCard(this.ॱ);
        View view = (LinearLayout) from.inflate(h.ꜟ, null);
        this.ˊ.ˏ(view);
        TitleCard titleCard = new TitleCard(this.ॱ);
        View inflate = from.inflate(h.ˏͺ, null);
        this.ॱॱ = inflate.findViewById(j.ʼꞌ);
        azb.ˏ(inflate, j.ʿ);
        titleCard.ˏ(inflate);
        this.ˊ.ˋ(titleCard);
        view.addView(inflate);
        View linearLayout = new LinearLayout(this.ॱ);
        LayoutParams layoutParams2 = new LinearLayout.LayoutParams(-1, -2);
        linearLayout.setOrientation(1);
        linearLayout.setLayoutParams(layoutParams2);
        linearLayout.setPadding(ˊ, applyDimension, ˏ, linearLayout.getPaddingBottom());
        for (ˊ = 0; ˊ < 3; ˊ++) {
            View view2 = (ViewGroup) from.inflate(h.ˌˏ, null);
            cgz courseListCard = new CourseListCard(this.ॱ);
            courseListCard.ˏ(view2);
            this.ˊ.ˋ(courseListCard);
            linearLayout.addView(view2, layoutParams);
        }
        view.addView(linearLayout);
        this.ᐝ = from.inflate(h.י, null);
        this.ˊ.ˋ(this.ᐝ);
        view.addView(this.ᐝ);
        ˊ(this.ˊ);
        viewGroup.addView(view, layoutParams);
        return true;
    }

    public void ˋ(chy o_chy) {
        this.ॱॱ.setOnClickListener(new cht$d(o_chy, this.ˊ.ˎ()));
        for (int i = 0; i < this.ˊ.ˊ(); i++) {
            cgz ˋ = this.ˊ.ˋ(i);
            if (ˋ instanceof CourseListCard) {
                ((CourseListCard) ˋ).ॱ(o_chy);
            }
        }
    }

    public ArrayList<String> z_() {
        if (this.ˊ != null) {
            return this.ˊ.ˋ();
        }
        return null;
    }
}
